package com.xiaowen.service;

import com.xiaowen.dao.CommentMapper;
import com.xiaowen.entity.Comment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by 15c on 2017/11/19.
 */
@Service("Comment")
public class CommentServiceImpl implements CommentService {
    @Autowired
    CommentMapper commentMapper;

    @Override
    public List<Comment> showListComment(Integer traveId) {
        return commentMapper.selectListComment(traveId);
    }

    @Override
    public int addComments(Comment comment) {
        return commentMapper.insertSelective(comment);
    }

    @Override
    public int deleteComments(Integer commentId) {
        return commentMapper.deleteByPrimaryKey(commentId);
    }

    @Override
    public int deleteListComments(Integer traveId) {
        return commentMapper.deleteListComments(traveId);
    }
}
